<template>
  <div class="strategy-list" ref="box">
    <div class="myvan-image4" ref="div" v-for="(item,index) in listData" :key="index+'2'">
      <div class="location-box">
        <van-image
          :src="item.imgSrc"
          rel="external nofollow"
        />
        <div class="location">
          <van-icon name="location" />
          <span>{{item.location}}</span>
        </div>
      </div>
      <!-- 标签 -->
      <div class="strategy-label">
        <div class="jingxuan-box">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-2"></use>
          </svg>
          <span>无人之境</span>
        </div>
        <svg class="icon jingxaun-icon" aria-hidden="true" v-if="item.flag">
          <use xlink:href="#icon-jingxuan1"></use>
        </svg>
      </div>
      <!-- 标题 -->
      <div class="strategy-title">
        <h5>{{item.title}}</h5>
      </div>
      <!-- 作者 -->
      <div class="author-box">
        <div class="avatar">
          <img :src="item.avatar" alt="">
          <div class="author">{{item.user}}</div>
        </div>
        <div class="thumbs-up">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-shezhi"></use>
          </svg>
          <span>{{item.thumbs}}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'strategyList',
  props: {
    listData: Array
  },
  data() {
    return {}
  },
  mounted() {
  },
  methods: {
  }
}
</script>
<style lang="scss" scoped>
.strategy-list {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  width: 100%;
  .myvan-image4 {
    width: 49%;
    height: 100%;
    border-radius: 12px;
    border: 1px solid rgb(207, 206, 206);
    overflow: hidden;
    margin-top: 20px;
    background-color: #fff;
    &:last-of-type {
      margin-bottom: 50px;
    }
    // 地点
    .location-box {
      position: relative;
        .van-image {
          width: 100%;
          height: 120px;
        }
        .location {
          width: 100%;
          height: $height;
          position: absolute;
          left: 0;
          bottom: 2px;
          display: flex;
          align-items: center;
          .van-icon, span {
            color: #fff;
          }
          .van-icon {
            margin: 0 4px;
          }
          span {
            font-size: 10px;
          }
        }
    }
    // 精选
    .strategy-label {
      width: 100%;
      height: $height;
      display: flex;
      flex-flow: row wrap;
      justify-content: space-between;
      padding: 0 10px;
      box-sizing: border-box;
      position: relative;
      .jingxuan-box {
        width: 80px;
        height: $height/2;
        background-color: rgb(240, 240, 240);
        border-radius: 6px;
        color: $color;
        span {
          font-size: 10px;
        }
      }
      .jingxaun-icon {
        font-size: 40px;
        position: absolute;
        right: 0;
        top: -20px;
      }
    }
    // 标题
    .strategy-title {
      width: 100%;
      padding: 0 8px;
      box-sizing: border-box;
      margin: 4px 0;
      h5 {
        width: 100%;
        height: 100%;
        font-size: 10px;
        text-overflow: -o-ellipsis-lastline;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
      }
    }
    // 作者
    .author-box {
      width: 100%;
      height: $height/2;
      display: flex;
      flex-flow: row nowrap;
      justify-content: space-between;
      padding: 0 6px;
      box-sizing: border-box;
      margin-bottom: $height/10;
      .avatar {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: left;
        img {
          width: $height/2;
          height: $height/2;
          border-radius: 50%;
        }
        .author {
          transform: scale(0.8);
          font-size: 8px;
        }
      }
      .thumbs-up {
        height: 100%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        svg {
          font-size: 14px;
        }
        span {
          transform: scale(0.8);
          font-size: 10px;
        }
      }
    }
  }
}
</style>